<div class="layui-layout layui-layout-admin">

    <div class="layui-body" style="margin: 1%">
        <!--<button class="layui-btn" onclick="">导入模板下载</button>
        <button class="layui-btn" onclick="">excel导入</button>
        <button class="layui-btn" onclick="">数据导出</button>-->
        <div class="layui-input-inline">
            <input type="text" class="layui-input" style="display: inline-block" id="search" placeholder="请输入要查找人员姓名">
        </div>
        <button class="layui-btn" onclick="getUserByName()">搜索</button>
        <button class="layui-btn" onclick="add()">新增</button>
        <!--<button class="layui-btn" onclick="changeImg()">更改图片</button>
        <img id="img1" src="common/fileTest/test.png">-->
        <table id = "userTable" lay-filter="userTable"></table>
        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
        </script>
    </div>

    <div id="setUser" class="layer_self_wrap" style="padding:20px;display:none;">
        <form id="userForm" class="layui-form layui-form-pane" method="post" action="">
            <input id="id" type="hidden" name="id"/>

            <div class="layui-form-item">
                <label class="layui-form-label">用户名称</label>
                <div class="layui-input-inline">
                    <input id="userName" name="userName" lay-verify="required" autocomplete="off" class="layui-input" type="text"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-inline">
                    <select id="sex" name="sex"  xm-select="sex">
                        <option value="1">男</option>
                        <option value="2">女</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">年龄</label>
                <div class="layui-input-inline">
                    <input id="age" name="age" lay-verify="required" autocomplete="off" class="layui-input" type="number"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手机号码</label>
                <div class="layui-input-inline">
                    <input id="phone" name="phone" lay-verify="required" autocomplete="off" class="layui-input" type="number"/>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 10px;text-align: center">
                    <button class="layui-btn"  lay-submit="" lay-filter="userSubmit">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>


</div>
<script src="/common/js/user/index.js"></script>
<script id="handleSex" type="text/html">
    {{#
    var fn = function(sex){
    var result="";
    if(sex == 1){
        result = "男"
    }else if(sex == 2){
        result = "女"
    }
    return result;
    }
    }}
    <div>{{fn(d.sex)}}</div>
</script>

